#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Jun 30 17:07:04 2024

@author: liqingsimac
"""

def sieve_v1(n):
    primes = list(range(2,n+1))
    for p in primes:
        if p*p>n:
            break
        product = 2*p
        while product <=n:
            if product in primes:
                primes.remove(product)
            product+=p
    return len(primes), primes
